import request from "../utils/request"

export const getData = () =>{
    return async (dispatch) =>{
        const data = await request.get("/list")
        dispatch({
            type:"ALLDATA",
            payload:data.data.list
        })
    }
}

export const checkTab = (key) =>{
    return {
        type:"CHECKTAB",
        payload:key
    }
}

export const addShopCar = (item) =>{
    return {
        type:"ADDSHOPCAR",
        payload:item
    }
}

export const addCount = (id) =>{
    return {
        type:"ADDCOUNT",
        payload:id
    }
}

export const delCount = (id) =>{
    return {
        type:"DELCOUNT",
        payload:id
    }
}

export const OneCheckBox = (obj) =>{
    return {
        type:"ONECHECKBOX",
        payload:obj
    }
}

export const ALLCheckBox = (check) =>{
    return {
        type:"AllCHECKBOX",
        payload:check
    }
}
export const delItem = (index) =>{
    return {
        type:"DELITEM",
        payload:index
    }
}